package com.mtung.concurrent.thread;

/**
 * @author zhenguo.yao
 * @date 2020/12/16
 */
public class Thread02 extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 1000000; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("子线程: " + Thread.currentThread().getName());
    }

    public static void main(String[] args) {
//        System.out.println("线程名: " + Thread.currentThread().getName());
//        Thread02 thread02 = new Thread02();
//        thread02.start();

//        Thread02 thread02 = new Thread02();
//        System.out.println("线程状态: "+thread02.getState());
//        thread02.start();
//        System.out.println("线程状态: "+thread02.getState());

//        thread02.wait();
//        thread02.notify();

    }

    // 线程名: main
    // 子线程: Thread-0
}
